#/!bin/bash

make clean
make cleancuda
rm out.mkv log
clear
make >> log
clear
echo "***************************************************************  ******"
echo "***          **         **    *******    ********    *********    *****"
echo "********  *****  *********  *  *****  *  *******  **  *******      ****"
echo "********  *****  *********  **  ***  **  ******  ****  *****        ***"
echo "********  *****      *****  ***    ****  *****          ***   SOFT   **"
echo "********  *****  *********  ***********  ****  ********  ***        ***"
echo "*******   *****  *********  ***********  ***  **********  ***      ****"
echo "*        ******        ***  ***********  **  ************  ***    *****"
echo "***************************************************************  ******"
echo "compilando..."
echo "make >> log"
make >> log
clear
echo "ejecutando"
echo "./x264 --pass 1 --bitrate 300 -o out.mkv akiyo_qcif.y4m 176x144"
echo "xD"
./x264 --pass 1 --bitrate 300 -o out.mkv akiyo_qcif.y4m 176x144

if (("$#" == "1")); then
$1 out.mkv &
else
echo "abrir $PWD/out.mkv para ver resultado"
fi
echo "***************************************************************  ******"
echo "***          **         **    *******    ********    *********    *****"
echo "********  *****  *********  *  *****  *  *******  **  *******      ****"
echo "********  *****  *********  **  ***  **  ******  ****  *****        ***"
echo "********  *****      *****  ***    ****  *****          ***   SOFT   **"
echo "********  *****  *********  ***********  ****  ********  ***        ***"
echo "*******   *****  *********  ***********  ***  **********  ***      ****"
echo "*        ******        ***  ***********  **  ************  ***    *****"
echo "***************************************************************  ******"